<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 作业5：让用户输入8个数据，升序排序,把大于10的并且是3的倍数的统计出来
    let arr = []
    for (let i = 1; i <= 8; i++) {
      let num = +prompt(`请输入第${i}个数`)
      // console.log(num);
      arr.push(num)
    }
    const res = arr.sort(function (a, b) {
      return (a - b)
    })
    // console.log(res);
    const obj = arr.map(item => {
      if (item > 10 && item % 3 === 0) {
        return item
      }
    })
    console.log(obj);
  </script>
</body>

</html>